cmake_minimum_required(VERSION 3.0)
project(testbin)

set(ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../)
set(COMMON_INCLUDE  ${ROOT_PATH}/include/ )

set(OPENCV_INCLUDE /usr/include/opencv4/ )  # 修正路径格式
set(OPENCV_LIBPATH /usr/lib/aarch64-linux-gnu/  ) 
set(OPENCV_LIBS opencv_highgui opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio)

set(RKNN_INCLUDE ${ROOT_PATH}/3rdparty/rknpu2/include )
set(RKNN_LIBPATH ${ROOT_PATH}/3rdparty/rknpu2/lib/) 
set(RKNN_LIBS rknnrt )

# 添加TurboJPEG库配置
set(TURBOJPEG_INCLUDE /usr/include/)  # 根据实际情况修改
set(TURBOJPEG_LIBPATH /usr/lib/aarch64-linux-gnu/)  # 根据实际情况修改
set(TURBOJPEG_LIBS turbojpeg)

# 添加RGA库配置
set(RGA_INCLUDE ${ROOT_PATH}/3rdparty/librga/include)  # 根据实际情况修改
set(RGA_LIBPATH ${ROOT_PATH}/3rdparty/librga/libs/Linux/gcc-aarch64)  # 根据实际情况修改
set(RGA_LIBS rga)

# compile flags
SET(CMAKE_CXX_FLAGS "-std=c++11  -pthread -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED -O3")

# include path
include_directories(${COMMON_INCLUDE})
include_directories(${RKNN_INCLUDE})
include_directories(${OPENCV_INCLUDE})
include_directories(${TURBOJPEG_INCLUDE})  # 添加TurboJPEG头文件路径
include_directories(${RGA_INCLUDE})  # 添加RGA头文件路径

# library path
link_directories(${RKNN_LIBPATH})
link_directories(${OPENCV_LIBPATH})
link_directories(${TURBOJPEG_LIBPATH})  # 添加TurboJPEG库路径
link_directories(${RGA_LIBPATH})  # 添加RGA库路径

#subdirectory
ADD_SUBDIRECTORY(test-infer)